package com.sinothk.view.tag3dcloud;


import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;

import com.sinothk.views.Tag3dCloud.TagCloudView;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link TestFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class TestFragment extends Fragment {
    private View rootView;
    private TagCloudView fragmentTagcloud;

    public TestFragment() {
        // Required empty public constructor
    }

    public static TestFragment newInstance() {
        TestFragment fragment = new TestFragment();
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_test, container, false);
        instantiationViews();

        String[] arr = new String[250];
////        for (int i = 0; i < arr.length; i++) {
////            arr[i] = ""
////        }
//        arr[0] = "计算机";
//        arr[1] = "保险业";
//        arr[2] = "采矿";
//        arr[3] = "能源";
//        arr[4] = "餐饮";
//        arr[5] = "宾馆";
//        arr[6] = "建筑业";
//        arr[7] = "教育";
//        arr[8] = "保健";
//        arr[9] = "金属冶炼";
//        arr[10] = "美容";
//        arr[11] = "媒体";
//        arr[12] = "出版";
//        arr[13] = "零售";
//        arr[14] = "农业";
//        arr[15] = "旅游业";
//        arr[16] = "司机";
//        arr[17] = "医疗服务";
//        arr[18] = "音乐舞蹈";
//        arr[19] = "邮政快递";


        TextTagsAdapter adapter = new TextTagsAdapter(arr);
        fragmentTagcloud.setAdapter(adapter);
        return rootView;
    }

    private void instantiationViews() {
        fragmentTagcloud = (TagCloudView) rootView.findViewById(R.id.fragment_tagcloud);
    }
}
